Do you have any tips for comments to keep them in step with the code? [closed]

Posted by Rob Wells on Stack Overflow See other posts from Stack Overflow or by Rob Wells
Published on 2010-04-10T22:09:25Z Indexed on 2010/04/11 9:53 UTC
Read the original article Hit count: 329

Filed under:
|
|

Possible Duplicate:
How do you like your comments?

G'day,

I've read both of Steve McConnell's excellent Code Complete books "Code Complete" and "Code Complete 2" and was wondering if people have any other suggestions for commenting code.

My commenting mantra could be summed up by the basic idea of expressing "what the code below cannot say".

While enjoying this interesting blog post by Jeff about commenting I was still left wondering "When coding, when do you feel a comment is required?"

Edit: Oops. Seems to be a duplicate of this question http://stackoverflow.com/questions/121945/how-do-you-like-your-comments so sorry for the noise. Thanks to my, seemingly, SO shadow for pointing it out - wouldn't have thought I was that interesting.

Now off to read the original post and see if it is relevant.

Edit: I meant to emphasise the best appraoch to ensure that your comments will stay in step with the code. Maybe expressing an intent rather than the mechansim for instance.

© Stack Overflow or respective owner

Related posts about Development

Related posts about comments